package com.ruoyi.visit.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.visit.mapper.AdPenaltyMapper;
import com.ruoyi.visit.domain.AdPenalty;
import com.ruoyi.visit.service.IAdPenaltyService;

/**
 * 行政处罚Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-08-23
 */
@Service
public class AdPenaltyServiceImpl implements IAdPenaltyService 
{
    @Autowired
    private AdPenaltyMapper adPenaltyMapper;

    /**
     * 查询行政处罚
     * 
     * @param apId 行政处罚ID
     * @return 行政处罚
     */
    @Override
    public AdPenalty selectAdPenaltyById(Long apId)
    {
        return adPenaltyMapper.selectAdPenaltyById(apId);
    }

    /**
     * 查询行政处罚列表
     * 
     * @param adPenalty 行政处罚
     * @return 行政处罚
     */
    @Override
    public List<AdPenalty> selectAdPenaltyList(AdPenalty adPenalty)
    {
        return adPenaltyMapper.selectAdPenaltyList(adPenalty);
    }

    /**
     * 新增行政处罚
     * 
     * @param adPenalty 行政处罚
     * @return 结果
     */
    @Override
    public int insertAdPenalty(AdPenalty adPenalty)
    {
        adPenalty.setCreateTime(DateUtils.getNowDate());
        return adPenaltyMapper.insertAdPenalty(adPenalty);
    }

    /**
     * 修改行政处罚
     * 
     * @param adPenalty 行政处罚
     * @return 结果
     */
    @Override
    public int updateAdPenalty(AdPenalty adPenalty)
    {
        adPenalty.setUpdateTime(DateUtils.getNowDate());
        return adPenaltyMapper.updateAdPenalty(adPenalty);
    }

    /**
     * 批量删除行政处罚
     * 
     * @param apIds 需要删除的行政处罚ID
     * @return 结果
     */
    @Override
    public int deleteAdPenaltyByIds(Long[] apIds)
    {
        return adPenaltyMapper.deleteAdPenaltyByIds(apIds);
    }

    /**
     * 删除行政处罚信息
     * 
     * @param apId 行政处罚ID
     * @return 结果
     */
    @Override
    public int deleteAdPenaltyById(Long apId)
    {
        return adPenaltyMapper.deleteAdPenaltyById(apId);
    }
}
